package joc.contract;

import java.lang.annotation.Annotation;

import joc.customize.Contract;
import joc.customize.ForFieldEvaluateAtBeginningOfAllMethods;
import joc.customize.ForFieldEvaluateAtEndOfAllBehaviors;
import joc.customize.ForMethodEvaluateAtEndOfMethodAndInherit;
import joc.customize.ForParameterEvaluateAtBeginningOfBehavior;

public class GreaterThanLongContract implements Contract {

	@Override
	public Class<? extends Annotation> getAnnotationClass() {
		return GreaterThanLong.class;
	}

	@ForFieldEvaluateAtBeginningOfAllMethods
	@ForFieldEvaluateAtEndOfAllBehaviors
	@ForParameterEvaluateAtBeginningOfBehavior
	@ForMethodEvaluateAtEndOfMethodAndInherit
	public boolean checkContract(GreaterThanLong annotation, long value) {
		return value > annotation.value();
	}

}
